//  TechnicianTabbarVC.m
//  XJMTechnician
//  Created by Mr.hu on 2017/10/9.
//  Copyright © 2017年 Mr.hu. All rights reserved.

#import "TechnicianTabbarVC.h"
#import "HomeOrderTechnician.h"
#import "MineVC.h"

@interface TechnicianTabbarVC ()

@end

@implementation TechnicianTabbarVC

- (void)viewDidLoad {
    [super viewDidLoad];
    
    [self tabbarCustomervc];
    
}

- (void)tabbarCustomervc{
    
    UINavigationController * una1=[[UINavigationController alloc]initWithRootViewController:[[HomeOrderTechnician alloc]init]];
    UINavigationController * una2=[[UINavigationController alloc]initWithRootViewController:[[MineVC alloc]init]];
    
    [self setViewControllers:@[una1,una2]];
    
    UITabBar * tab = self.tabBar;
    UITabBarItem * itemOne = [tab.items objectAtIndex:0];
    UITabBarItem * itemTwo = [tab.items objectAtIndex:1];
    
    itemOne.imageInsets = UIEdgeInsetsMake(-2.5, 0, 2.5, 0);
    itemTwo.imageInsets = UIEdgeInsetsMake(-2.5, 0, 2.5, 0);
   
    itemOne.selectedImage = [[UIImage imageNamed:@"dingdan"]imageWithRenderingMode:UIImageRenderingModeAlwaysOriginal];
    itemOne.image = [[UIImage imageNamed:@"dingdanDefault"]imageWithRenderingMode:UIImageRenderingModeAlwaysOriginal];
    itemOne.title = @"订单";
    
    itemTwo.selectedImage = [[UIImage imageNamed:@"wodeSelect"]imageWithRenderingMode:UIImageRenderingModeAlwaysOriginal];
    itemTwo.image = [[UIImage imageNamed:@"wode"]imageWithRenderingMode:UIImageRenderingModeAlwaysOriginal];
    itemTwo.title = @"我的";
    
    itemOne.titlePositionAdjustment = UIOffsetMake(-0, -3);
    itemTwo.titlePositionAdjustment = UIOffsetMake(-0, -3);
    
    [itemOne setTitleTextAttributes:@{NSFontAttributeName:[UIFont systemFontOfSize:11]} forState:UIControlStateNormal];
    [itemTwo setTitleTextAttributes:@{NSFontAttributeName:[UIFont systemFontOfSize:11]} forState:UIControlStateNormal];
    
    [itemOne setTitleTextAttributes:@{NSForegroundColorAttributeName:RGBA(51, 51, 51, 1)} forState:UIControlStateNormal];
    [itemTwo setTitleTextAttributes:@{NSForegroundColorAttributeName:RGBA(51, 51, 51, 1)} forState:UIControlStateNormal];
    
    [itemOne setTitleTextAttributes:@{NSForegroundColorAttributeName:RGBA(234, 0, 0, 1)} forState:UIControlStateSelected];
    [itemTwo setTitleTextAttributes:@{NSForegroundColorAttributeName:RGBA(234, 0, 0, 1)} forState:UIControlStateSelected];
    
    [[UITabBar appearance] setBarTintColor:[UIColor whiteColor]];
    [UITabBar appearance].translucent = NO; //取消tabBar的透明效果。
    
    [[UITabBarItem appearance]setTitleTextAttributes:@{NSForegroundColorAttributeName:[UIColor whiteColor]} forState:UIControlStateSelected];
    
}


- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

/*
#pragma mark - Navigation

// In a storyboard-based application, you will often want to do a little preparation before navigation
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
    // Get the new view controller using [segue destinationViewController].
    // Pass the selected object to the new view controller.
}
*/

@end
